<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <!--为了移动端更好的浏览-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
    <title>前台登录页面</title>
</head>
<body>
<div class="m-container-small m-padded-tb-massive" style="max-width: 30em !important;">
    <div class="ui container">

        <div class="ui middle aligned center aligned grid">
            <div class="column">
                <h2 class="ui teal image header">
                    <!--<img src="assets/images/logo.png" class="image">-->
                    <div class="content" th:text="#{login.tip}">
                        前台管理登录
                    </div>
                </h2>
                <form class="ui large form" method="post" th:action="@{/login}">
                    <div class="ui stacked segment">
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="user icon"></i>
                                <input type="text" name="travelername" th:placeholder="#{login.travelername}">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="lock icon"></i>
                                <input type="password" name="travelerpassword" th:placeholder="#{login.travelerpassword}">
                            </div>
                        </div>
                        <button class="ui fluid large teal submit button btn" th:text="#{login.btn}">登录</button>
                    </div>

                    <div class="ui error message"></div>
                    <div class="ui mini negative message" th:unless="${#strings.isEmpty(param.message)}" th:text="${param.message}"></div>
                </form>
                <div class="ui segment">
                    <a th:href="@{/register}"><button class="ui fluid large teal button register" th:text="#{login.register}">注册</button></a>
                </div>
                <div class="ui segment">
                    <a th:href="@{/login.html(l='zh_CN')}"><button class="ui fluid large teal button">中文</button></a><br/>
                    <a th:href="@{/login.html(l='en_US')}"><button class="ui fluid large teal button">English</button></a>
                </div>
            </div>
        </div>
    </div>
</div>

<!--以网址连接的方式引入资源-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

<script>
    $('.ui.form').form({
        fields: {
            travelername: {
                identifier: 'travelername',
                rules: [{
                    type: 'empty',
                    prompt: '请输入用户名'
                }]
            },
            travelerpassword: {
                identifier: 'travelerpassword',
                rules: [{
                    type: 'empty',
                    prompt: '请输入密码'
                }]
            }
        }
    });
</script>

</body>
</html>